﻿using System;
using System.Configuration;
using System.Linq;
using Controllers;

namespace Web
{
    public partial class EmpPromotionList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string empId = Request.QueryString["empId"];
            ApolloOaDataContext ctx = new ApolloOaDataContext(ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString);
            var v = ctx.ExecuteQuery<PromotionDTO>(@"SELECT a.Id,a.StartDate,a.EndDate,a.Duty,b.Text,c.Name
  FROM EmpPromotion a,Depts b,Positions c
  where a.DeptId=b.Id and a.PosId=c.Id and a.EmpId=" +empId+";");
            rptList.DataSource = v;
            rptList.DataBind();
        }
    }
}